POV-Ray : Newsgroups : povray.off-topic : Any Java experts? : Re: Any Java experts? Server Time
10 Oct 2024 23:17:20 EDT (-0400)
  Re: Any Java experts?  
From: Darren New
Date: 17 Jan 2008 22:25:17
Message: <47901c1d$1@news.povray.org>
Gail Shaw wrote:
> Is there anyone who can tell me why the following code sometimes (not
> always) throws a NullPointerException
> Using Java(TM) SE Runtime Environment (build 1.6.0_02-b06)
> 
> Node currentNode = Universe.space[i][j]; // Have checked and this is never
> null.

Then you should have an assertion in there to that effect. :-)

> And here's an abbreviated version of the Node class.

Your exception isn't being caused at this line. Or your JVM is broken. 
Or currentNode is winding up a subclass of Node with different code.


Print everything just before you get there, or wrap the whole 
questionable chunk in a try/catch and print out everything when it throws.

-- 
   Darren New / San Diego, CA, USA (PST)
     It's not feature creep if you put it
     at the end and adjust the release date.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.